<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Laboratório de Sistemas Embarcados e Computação Pervasiva - IEmbedded</title>
    <link rel="stylesheet" href="${resource(dir:'css',file:'styles.css')}" />
    <link rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
    <style type="text/css">
.style1 {
	text-align: right;
}
</style>
  </head>
<body>
  <table width="100%"  border="0" align="right" cellpadding="0" cellspacing="0">
    <tr><th width="14%" bgcolor="#F9F9F9" scope="col">
        <table height="100%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#808080">
        <tr><th scope="col">
            <img src="${resource(dir:'images',file:'logo.png')}" ALT="" WIDTH=244 HEIGHT=91 border="0"/><img src="${resource(dir:'images',file:'tit_site.jpg')}" ALT="" WIDTH=518 HEIGHT=91 border="0"/>
        </tr></tr>
      	
          <g:if test="${session.user != null}">
                  <tr><td valign="top" align="right" height="259" bgcolor="#FFFFFF"><table width="100%" align="right" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <th height="19" scope="col">&nbsp;</th>
              <th scope="col">&nbsp;</th>
            </tr>      
            <g:form controller="user" action="logout" method="post" >
            <tr>
              <th height="19" class="itembar" scope="col">&nbsp;</th>
              <th class="itembar" scope="col">
                <div align="left" class="itembar">
                  <p class="style1"><label for="login">Logged user: ${session?.user} | </label>
				  <a href="logout">Logout</a></p>
	        </div></th>                
              <th class="itembar" scope="col">&nbsp;</th>              
	      </tr>
            </g:form>
	    </g:if>
              <g:else>
            <tr><td valign="top" align="right" height="259" bgcolor="#FFFFFF"><table width="100%" align="right" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <th height="19" scope="col">&nbsp;</th>
              <th scope="col">&nbsp;</th>
            </tr>      
                      <tr>
                        <th height="19" class="itembar" scope="col">&nbsp;</th>
                        <th class="itembar" scope="col"><div align="left" class="itembar">Bem vindo ao IEmbedded!</div></th>
                        <th class="itembar" scope="col">&nbsp;</th>
                      </tr>
                      <tr>
                        <th height="213" scope="col">&nbsp;</th>
                        <th scope="col"><p class="corpoItem">
                            Utilize este site para gerenciar suas contas do laboratório Embedded.
                            <br>Use sua senha geral Embedded Lab (EmbeddedSys) para fazer login.</br></p>

                          <g:form controller="user" action="handleLogin" method="post" >
		              <table width="100%"  border="0" align="center">
                                  <tr><td style="width: 27%">&nbsp;</td><td style="width: 45%"><table width="100%" border="0">
			               <tr>
                                         <td class="style1" style="width: 119px"><span class="corpoItem"><label for='login'><strong>
										 Nome de usuário</strong>:</label></span></td>
                                         <td width="120" class='value ${hasErrors(bean:user,field:'login','errors')}'><span class="corpoItem">
                                         <input type="text" id='login' name='login' value="${user?.login?.encodeAsHTML()}"/>
                                         </span></td><td style="width: 32px">&nbsp;</td>
                                       </tr>
                                       <tr>
                                         <td class="style1" style="width: 119px"><span class="corpoItem"><label for='password'><strong>Senha</strong>:</label></span></td>
                                         <td width="120" class='value ${hasErrors(bean:user,field:'password','errors')}'><span class="corpoItem">
                                         <input type="password" name='password' value="${user?.password?.encodeAsHTML()}"/>
                                         </span></td><td style="width: 32px">&nbsp;</td>
                                       
                                        <td style="width: 32px"><span class="corpoItem"><input class="save" type="submit" value="Login" /></span></td>
                                  </tr></tr>
                              </table><div align="center"></div></td><td width="33%">&nbsp;</td>
                              </tr></table>
		              <!-- if invalid login  -->
		               <g:if test="${flash.message}">
           			 <div class="message">${flash.message}</div>
                               </g:if>
		            </g:form>	            
		    <p class="corpoItem">Esqueceu a senha? <span class="corpoItem"><strong><a href="javascript:openforgotPassword()">Clique aqui!!</a></strong>
	            </g:else>
	        </td></tr></table>
        <g:layoutBody />
	</body>
</html>
